using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Drawing;
using System.Xml;
using System.Drawing.Design;

namespace TVDesigner.Entities.Elements
{
    [XmlRoot("HButton")]
    public class HButton : HIcon
    {
        private string _FocusImage;
        private string _ScreenName;
        private string _Text;
        private Color _TextColor;
        private Color _FocusTextColor;
        private bool _Focusable;

        public HButton() : base()
        {
            _Focusable = true;
        }

        #region Propriedades

        [XmlAttributeAttribute("Text")]
        [Category("Apperance")]
        public string Text
        {
            get { return _Text; }
            set { _Text = value; }
        }

        [XmlAttributeAttribute("Focusable")]
        [Category("Apperance")]
        public bool Focusable
        {
            get { return _Focusable; }
            set { _Focusable = value; }
        }

        [XmlElementAttribute("TextColor")]
        [Category("Apperance")]
        public Color TextColor
        {
            get { return _TextColor; }
            set { _TextColor = value; }
        }

        [XmlElementAttribute("FocusTextColor")]
        [Category("Apperance")]
        public Color FocusTextColor
        {
            get { return _FocusTextColor; }
            set { _FocusTextColor = value; }
        }

        [XmlAttributeAttribute("FocusImage")]
        [Category("Imagem")]
        [Editor(typeof(PropertyFileChooserEditor), typeof(UITypeEditor))]
        public string FocusImage
        {
            get { return _FocusImage; }
            set
            {
                _FocusImage = value;
            }
        }

        //[Browsable(false)]
        [Category("Action")]
        [XmlAttributeAttribute("HScreenName")]
        [Editor(typeof(PropertyComboScreenChoserEditor), typeof(UITypeEditor))]
        public string ScreenName
        {
            get { return _ScreenName; }
            set { _ScreenName = value; }
        }

        //[NonSerialized]
        //[Designer("System.Windows.Forms.Design.ListBoxDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
        [XmlIgnoreAttribute()]
        public List<string> DestinationScreen
        {
            get
            {
                List<string> list = new List<string>();
                foreach (Screen sc in this.ParentScreen.GetProject().Screens)
                {
                    if (this.ParentScreen == null || !this.ParentScreen.Equals(sc))
                    {
                        list.Add(sc.Name);
                    }
                }

                return list;
            }
        }
        #endregion



    }
}
